<script>
	import {mapState} from 'vuex';
	export default {
		onLaunch: function() {
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		computed:{
			...mapState(["user"])
		},
		watch:{
			// #ifdef H5
			'$route.path': {
				handler: function(val, old){
					const current = new Date().getTime()
					if(!(val === "/" || val === "/pages/login/login")){
						if(!this.user.expiration){
							uni.navigateTo({
								url:"/",
								fail(res) {
									console.log(res)
								}
							})
						}
					}
				}
			}
			// #endif
		}
	}
</script>

<style>
    /* #ifndef APP-PLUS-NVUE */
    /* uni.css - 通用组件、模板样式库，可以当作一套ui库应用 */
    @import './common/uni.css';
    /* #endif*/
	uni-page-body {
		min-height: 100% !important;
		height: auto !important;
		
	}
	/* #ifndef H5 */
	uni-page-body::before{
		content: "<view class="status_bar">qqq</view>";
		
	}
	.status_bar{
		height: var(--status-bar-height);
		width: 100%;
	}
	/* #endif */
</style>
